import 'antd/dist/antd.min.css'

import React, {Component} from 'react';
import './App.css';
import Index from "./page/Index/Index";

import {Route, Router} from 'react-router-dom'
import * as browserHistory from 'history'
import Main from "./Main";

const IndexCopy = Index
// @ts-ignore
const IndexRoutes = ({match}) => {

    return (<Route path={`${match.url}(/*)`} component={Index}/>)
}

class App extends Component {

    render(): React.ReactNode {
        return (
            <div>
                <Router history={browserHistory.createHashHistory()}>


                    <Route>
                        <div>

                            <Route path='/' component={Main} exact/>


                            {/*<Route path={'/index'} component={Index}>
                                 嵌套子路由
                                <Route path={'/index/:page'}/>
                            </Route>*/}


                            <Route path={'/index'} component={IndexRoutes}/>


                            <Route path={'/react'} component={Main} exact/>
                        </div>

                    </Route>

                </Router>
            </div>
        );
    }
}

export default App;
